added helper function for openning files