refactor ajax
bugfix for param pass