added if to test class