fixed some bugs with kernel launching