pass object instead of class