minor bug fix in unsafe