fix coordinates assignment and infinite loop during navigation