adds if/else so that 0/0 error doesn't happen