Added coordinate validation and error message