fixed some issue with validation