Proper handling of the refresh button - Closes #176