fix useless variables casting