added conditional for getComputedStyle