add callbacks, fix header boundary