Implemented thread checking and execution for Location tasks