It is necessary to write at the back of the check " For deposit only" along with the bank account number or some bank also does by signing your name underneath when it is endorsed because by doing so the check will be deposited to your account. This is called a " restrictive endorsement " .
and it will prevent you and any other person from cashing the check or any other illegal or false activities.