bug fix, verified it works this time