Resolved directory error for comments function