added minimalistic error handling