error handling and functions for Row()