couple of tweaks and validation checks added