fix to bugs caused by last merge