removed redundant while