edited if statement