correcting logical mistake