fixed an error in the divide method