minor fix and protection