fixed function renaming, added checks to initial function name