added function from original plugin