added small fix with validation