added check for libdl