Added some check to key param