You've forgot to close cursor after yo've finished using it