Added sr parameter to monitorActivity function