fixed bug in once implementation