Cloud computing has transformed the way businesses and consumers think about their data and businesses. As a result, cloud computing is described as the on-demand availability of all computer system resources via the Internet as a paid service. Enhancing security is a major problem in cloud computing, which is also a major research topic because data is stored and processed in remote locations held by third parties. Another key research subject is the allocation of virtual machines to incoming workloads to decrease the cost of consumers' workload execution in cloud environments. Both of the aforementioned difficulties are addressed in this study. Deadline-constrained workflows are submitted to the application server, which goes through a pre-processing step, that identifies the presence of anomalies in the workflow tasks and disqualifies those tasks with anomalies, and schedules the adjusted workloads into heterogeneous Virtual machines using a modified-PCP algorithm. Our approach is compared to the IC-LOSS and IC-PCP algorithms that are already in use. In comparison to the existing IC-PCP and IC-LOSS algorithms, experimental results suggest that using the modified-PCP algorithm for deadline constrained workflows after deleting those anomalous tasks produces better results.