Made loader state able to be updated by middlewares