validation functionality properly work but still BUGGY