added ajax loading and error