replaced exception handling with if statement