fixing ajax and messaging