fixing some bugs on taking an action