Adding escape function