remove redundant else so that function does not miss return statement