almost positive this fixes a bug, did not test