some cleanup
check parameters