write keys in constructor