Checking if savedPage is defined fixes submit bug