fix bugs and extent