Investigation of the stability of superheavy nuclei aroundZ=114 andZ=164