moved into doc ready