Fixed bugs

Fixed bugs
Add caption
Add afterHeaderCreated function