got rid of the casting in the if statement.