Resolved issue with page refreshing