Controller updated with validation