Fix bug in environment variables. Add sharedLocation function