fix for javascript error in phreepos closing