added error messge variable to capture the errors occurred while applying them