adding init method for passing resource config