fixed some errors after validation