bug fix. unsure if correct