fixed bug where function names were not unique