add the code for resolveMode but currently commented out until further test is done