changes to fix bugs. updates for validation