fixed js isssue caused by ajax