fixed faulty handling of checks
merging