#30 Fixed NoneType error in controller