changed custom function