replaced getAttribute with query attr