fix fatal error that API is already in use