Removed unneeded code from controller.
Added validation.