Adjust function that executes custom script