Standard error handling added.