added ajax with timeout and error handler