updated folder checking and added additional session functions in hooks