fix background task running on foreground
fix update location when not logged