js slightly adjusted to avoid grey background