Fixed logic mistake