Remove duplicate if statement
credit to Nick Reuter