Solved issue where the last visited space would be set to 0