fixed avail store locking and closing opened fds