Fix bug in krakdroid middleware