Eric's bug fix