Added error handling, page reload after upload media