fix bug: capture files not only directories