fixed some stability issues