Added bug fix that happened sometimes