fixed ref bug
refbug squashed