created two private methods in app controller
added helper method