another attempt to fix dealing with error