added more checks to reduce FORKING :)