Moved beacon check from GPS callback to main loop, because the callback can block