fix bugs found