fixed bug in user code