changed ajax event trigger so it can be hooked into more easily