bug fixes after updating controller merge into refactored model