added check to deploy method