fixes an error in line 317