some exceptions handling. very neat...