Greg ajax fix and unit test