fix check for empty value

thanks @methane