fix cut on function