fix crash when scrolling down in a table view and then leaving the view
updated version