added some fixes for generators
- check whether view exists
- check whether trigger exists