fixed error in casting pixel percent