fixed up some stability issues