added some more checks for stability reasons