fixes to bugs