fix division by zero in veiws