fixing check for init key inside constructor