add mutex
add defer to guard against unexpected panics
Merge pull request #101 from Mistobaan/master

add mutex