removed function_exists check since it made the function break