copy and pasted sample code and everything is working