added nginx error handling