update checkRoot implementation to include sudo