fixed empty key and value problem