Avoid last unnecesary record casting

This patch avois last unneeded record casting