- fix the datapicker directive
- more concise error handling