fixing some bugs caused by recent updates