fix bugs and new improvements