moved isopen check to it's own function

moved isopen check to it's own function...