rewrite ajax part