bad paste + added extra checks