made stuff more robust