tried to fix bug, not sure if worked