Added new class file but getting null pointer error in my constructor