Update badge count and table view when entering foreground