correct a logic mistake