Fixed logical mistake