fix import errors and based template