adding function_exists checks