changed check for static methods with help from the ReflectionMethod