added exception handling and internalization support