added more ajax functionality to chat