Fix wrong logic