added back to top logic