check for index < 0 handled in delete file function