Ajax added and fix errors