fix some bug, but still time problems