Change condition to check online