some prelimnary error handling lot more todo