Preventing weird bug