fix nasty bug