Added more debug info and error control in gps update