Fix set the same mode

Signed-off-by: Andreea Hodea <hodea_andreea@yahoo.com>