Fix minor logic mistake