fixed an error i caused to mahmoud's work