changed to if method