Fixed bug in above