use a more portable function syntax for bash