Fix flexible code + added alert();