removed unnecessary cast from tryGetById()