moved beforeLoad functions after transition out