fix cast None to int