Added condition for caret in file menu