Removed duplicate if statement