Added ajax functionality