added background and input check