fixed really nasty bug