Fix totally wrong logic(my head is not working now-_-)