Fixed wrong logic.