Fixed bugs and execution logic