Added minimal error handling