bugfix on the escape function