correctly implemented ALOCK