fixes, extra checks added.