added timer on socket select to ensure safe exit
generates location.json file for user