check hidden flag better