added solution to ajax problem