fixed small bugs with page loading