changed the way to determine location
fixed date parsing issues