Fixed bug in detect dawn code