add null check on decodeHash