added check for line numbers