added error handling for function calls that don't exist