decode keys before using