Devices that are connected on the internet and are exchanging data with internet brokers to receive requested services are a significant part of internet users. In order to manage and account well to IoT requests maximum processing power, speed in data transfer, and proper combining services in minimum time is needed. Since there is a large number of IoT devices which have a large scale, we have to use the abilities and services of cloud environment in order to solve its problems. So, service composition in a cloud environment is paid attention recently. We want to suggest an algorithm with the approach in this research, of improving factors propounded in the service composition problem like the number of clouds involved in service, number of services examined before responding to users’ requests SP and load balance between clouds. In this paper, the factor, similarity measure, is introduced and used to find the best cloud and composition plan in each phase which in addition to improving QoS metrics propounded in previous papers, it caused improving QoS metric of load balancing between clouds, prevention of formation of a bottleneck in clouds entrance. These changes, besides the proper load balancing, have avoided the clouds stop working suddenly and satisfied the users by presenting the services faster.