add create device function