added declarations and ajax