added ajax stuffs to plugin