introduced new variable to take the buffer
syntax error fixes