Removed unneeded code
Fixed bug