merge of kraus' fix