removed (int) and checked for 0. #990