added wait function for adding new folder that is checking the variable in created message