Bug fix in before_action
Bug fix in before_action
Added more tests