Attempt at bug fix