added if/else to reflect hitting the refresh button and have a half working check-box version