adds folder option and some robustness for message retrieval