Made a check function to determine if the given line number to delete task is valid