adding a null check on the key decoder