Fix problems with ajax