changed try to if