change argument check for better integration into other libs