more check, improved functionality