protect against ClassCastException for ids which are Double not Long