fixing ajax error, shifting it to seperate page