implemented lock on buttons to avoid duplicate asynchronous calls.