modified write statement