improved checking if file is executable