Added error validation in the assignment model