general fix and error management