fixes #343 - better script checks