Fixed wrong order of actions