Adding partition check

Change made in next commit.