bug fixes and refresh button