fixes to new code