Fix dividebyzeroexception