empty array inputStorage fix

initialized inputStorage correctly and added empty condition