added class and method existance checks