fixing error in messages controller