was not using singleton pattern