fixing a wierd bug