loader: fixed missing catch, added reject on failed declare call