also check if at beginning of document