Added validation for key not setted