fixing a potential bug