Updated exception message and added formatting