fix to cast serial commands

now it works correctly