Fixed minor mistakes

-in faulty logic