Added dynamic flash messages and check if folder exists