fixing bug in case checking function, starting to troubleshoot ES routines not opening.