prtection against detector number not to crash for database access