added preloop