main bug fixies