Added a check to make sure that start_port <= end_port. Returns invalid range error otherwise.