casting result to avoid warnings in toints