Extension check for methods

Added a check for the file extension.