updated function code in ./functions/