bug fixes to remove errors\