Indent this if() and the two above it so that it is inside the if(isopen) scope, and then remove the "&& isopen"