fix for #554 and #552