Need to check empty status too

Signed-off-by: Chris <zidane@outlook.com>