Added bug check