Fixed appending function call when it does not exist in script