fix bugs, refactoring, url now change with ajax