fix loader bug when orientation changes