fixed some possible issues