cleaned up refresh bug