fixed bug when returning back to main page