Add more conditions to check when unique equals true

Signed-off-by: Eduardo Stuart <contato@eduardostuart.com.br>