fix bugs from blind coding