fixing ajax calls