Improve module exists check