adding check function