Fixed null pointer with functions
: