fixed validation and some other tweaks