Added new two options, headerClass and footerClass
and proper promise