implmented location saving