Made beginning check more robust