fixed functions.sh