changed lock behaviour as discussed in #750