fix bug in safe region check
prettier colors