Added a missing line of code. And removed some unneeded code.