changes to add formatter and custom exception