Open file function redefined