fixed wrong execution bug