added more conditions to not if