fix bugs, improvements